import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入一个数a：");
        int a = scan.nextInt();
        System.out.print("请输入一个数b：");
        int b = scan.nextInt();
        int c = a%b;
        while(c!=0) {
            a = b;
            b = c;
            c = a%b;
        }
        System.out.println("a和b的最大公约数为："+b);
    }

}
